# -*- coding: utf-8 -*-

import hashlib
from base import UserCase, Runner, TestSuite


class Case(UserCase):

    def test_filter_error(self):
        '过滤器给的不对，服务端不能出 500'

        p = {
            'name': self.randhan(8),
            'username': self.randchar(8),
            'password': hashlib.md5(self.randchar(8)).hexdigest(),
        }
        res = self.c.open('/api/corp/create', p)
        self.assertEqual(res['code'], 0)

        res = self.c.open('/api/action-log/list', {'orderBy': 'id', 'orderDesc': '1'}, 'GET')
        self.assertEqual(res['code'], -2)



test_list = [
    'test_filter_error',
]
Suite = TestSuite([Case(t) for t in test_list])


if __name__ == '__main__':
    Runner.run(Suite)



 
